From: Georges Basile Stavracas Neto Date: Wed, 16 Sep 2020 17:44:49 +0000 (-0300) Subject: appDisplay: Disconnect from parental controls on destroy X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~655^2^2~32 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5014d7e9fce3a60f090040dd0a651f9411a19657;p=gnome-shell.git appDisplay: Disconnect from parental controls on destroy BaseAppView not disconnecting from the 'app-filter-changed' signal means parental controls may trigger callbacks on a destroyed grid, which tries to access destroyed icons, which spams the journal with stack traces. Disconnect from parental controls when BaseAppView is destroyed. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1441 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 68fdbdd0e..f9e6a9b7d 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -188,9 +188,10 @@ var BaseAppView = GObject.registerClass({ // Filter the apps through the user’s parental controls. this._parentalControlsManager = ParentalControlsManager.getDefault(); - this._parentalControlsManager.connect('app-filter-changed', () => { - this._redisplay(); - }); + this._appFilterChangedId = + this._parentalControlsManager.connect('app-filter-changed', () => { + this._redisplay(); + }); // Drag n' Drop this._lastOvershoot = -1; @@ -206,6 +207,10 @@ var BaseAppView = GObject.registerClass({ } _onDestroy() { + if (this._appFilterChangedId > 0) { + this._parentalControlsManager.disconnect(this._appFilterChangedId); + this._appFilterChangedId = 0; + } this._removeDelayedMove(); this._disconnectDnD(); }